package com.learn.chain.second;

public class Request {

    private String url;
    private String mediaType;
    private String body;
    private String header;

    public Request(Builder builder) {
        this.url = builder.url;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getMediaType() {
        return mediaType;
    }

    public void setMediaType(String mediaType) {
        this.mediaType = mediaType;
    }

    public static class Builder {

        private String url;

        public Builder url(String url) {
            this.url = url;
            return this;
        }

        public Request build() {
            return new Request(this);
        }
    }

    @Override
    public String toString() {
        return "Request{" +
                "url='" + url + '\'' +
                ", mediaType='" + mediaType + '\'' +
                ", body='" + body + '\'' +
                ", header='" + header + '\'' +
                '}';
    }

}
